var step = 1;

function showNextStep(stepID) {
    mostrar(stepID);
    step++;
}

function startVideo() {
    if(step == 1) {
        mostrar('T1S1-complete');
        showNextStep('T1S2');
    }
}

function pauseVideo() {
    if(step == 2 && !document.getElementById("reproductor").seeking) {
        mostrar('T1S2-complete');
        showNextStep('T1S3');
    }
}

function updateTime() {
    if(step == 3) {
        mostrar('T1S3-complete');
        showNextStep('T1S4');
    }
}

document.addEventListener("mozfullscreenchange",
	function () {
		if (step == 4 && !document.mozFullScreen) {
			mostrar('T1S4-complete');
			showNextStep('T1S5');
		}
	}, false);

$('#reproductor').bind('webkitfullscreenchange mozfullscreenchange fullscreenchange', function(e) {
    var state = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
    if(step == 4 && state) {
        mostrar('T1S4-complete');
        showNextStep('T1S5');
    }
});

function changeVideoVolume() {
    if(step == 5) {
        mostrar('T1S5-complete');
        mostrar('T-complete');		
    }
}
